from forum.models import UserImg


def setUserImage(user, path, article):
    imgs = UserImg.objects.filter(owner=user, relative_path=path);
    if len(imgs) != 1: return False
    img = imgs[0]

    img.article = article
    img.save()
    return True

